<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改合同模板、常见问题关系')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-templateProblem-edit" th:object="${contractTemplateProblem}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">合同模板：</label>
                <div class="col-sm-8">
                    <select th:field="*{contractTemplateId}"  name="contractTemplateId" class="form-control m-b" required>
                        <option th:each="type : ${contractTemplateList}" th:text="${type.title}" th:value="${type.id}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">常见问题：</label>
                <div class="col-sm-8">
                    <select th:field="*{commonProblemId}"  name="commonProblemId" class="form-control m-b" required>
                        <option th:each="type : ${commonProblemList}" th:text="${type.title}" th:value="${type.id}"></option>
                    </select>
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remark" th:field="*{remark}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "front/templateProblem";
        $("#form-templateProblem-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-templateProblem-edit').serialize());
            }
        }

        $("input[name='checkTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>